chore(deploy): :staging image tag + notify infra on migration changes#188
Merged
Conversation
… changes The CF Containers staging environment pulls api images via the :staging tag (see infra/wrangler/api/wrangler.toml). Add :staging alongside the existing :version and :latest tags so every master push produces a staging-ready image. Also adds a notify-infra-on-migration workflow that sends a repository_dispatch to instanode-dev/infra when migrations change, triggering an immediate rebuild of the pg-platform staging Container image (which bakes all 63 migrations into /docker-entrypoint-initdb.d). Without this, infra's daily cron picks up the change with ~24h lag. Graceful no-op if INFRA_DISPATCH_TOKEN secret is unset. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9 tasks
Pulls in 4759b67+ so diff-cover can find the merge base for patch coverage. Pre-existing coverage.yml uses --depth=1 fetch which can't find the base when origin/master advances after the branch is cut.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
:stagingtag to the existing buildx--push(line 251 of deploy.yml). Every master push now publishesghcr.io/instanode-dev/instant-api:stagingalongside the existing:versionand:latesttags.notify-infra-on-migration.ymlworkflow: sendsrepository_dispatchtypemigrations-changedtoinstanode-dev/infrawheninternal/db/migrations/**changes on master, triggering an immediate rebuild of the pg-platform staging Container image.INFRA_DISPATCH_TOKENsecret is unset (logs notice, exits 0; infra's daily cron remains the fallback).Why
The CF Containers staging environment at
infra/wrangler/api/wrangler.tomlpulls the:stagingtag. Thepg-platformstaging image atinfra/wrangler/pg-platform/Dockerfilebakes all 63 platform migrations into/docker-entrypoint-initdb.d/— without the notify workflow, new migrations don't reach staging for up to 24h.Companion PR: InstaNode-dev/infra#32
Test plan
Deployworkflow green (unchanged behavior except one extra-tflag on buildx)notify-infra-on-migration.ymlshows the "skip if token unset" path on the first run (since the secret hasn't been set yet)ghcr.io/instanode-dev/instant-api:stagingdigest matches:latestfor the same SHA viagh api packages/...gh secret set INFRA_DISPATCH_TOKEN -R instanode-dev/apito enable the dispatch pathwrangler-build-staging-images.ymlfires within ~2min🤖 Generated with Claude Code